<?php
include_once("../includes/page_utf_class.php");
include_once("../module/product/includes/plugin_order_class.php");
include("../lang/cn/company_type_config.php");
$order = new order;
//=======================
//-----------------
$export_sql=$sql="select * from ".MAGICORDER."  where 1  order by id desc";


//=============================
$page = new Page;
$page->listRows=20;
if (!$page->__get('totalRows')){
	$db->query($sql);
	$de['count']=$page->totalRows = $db->num_rows();
}
$de['count']=$de['count']?$de['count']:$_GET['totalRows'];
$sql .= "  limit ".$page->firstRow.",".$page->listRows;
$de['page'] = $page->prompt();
//=============================
$db->query($sql);
$ss=$db->getRows();
foreach($ss as $k)
{
    //获取上家店铺名称
    $sql = "select * from haiou_micro_shop where member_id = ".$k['direct_rec_mid']."";
    $db->query($sql);
    $res = $db->getRows();
    $k['direct_rec_mid'] = $res[0]['name'];
    
    //获取消费者名称
    $sql = "select * from haiou_member_other_platform where userid = ".$k['member_id']."";
    $db->query($sql);
    $res = $db->getRows();
    $k['member_id'] = $res[0]['name']?$res[0]['name']:$k['member_id'];
	$list[]=$k;
	
}
$de["list"]=$list;

$tpl->assign("de",$de);
$tpl->display("magic_order.htm");

?>